﻿<UserControl x:Class="SLMapApp.MainPage"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="302" d:DesignWidth="666">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol0" Size="9" Color="Yellow" Style="Circle" />
            <!--渲染图层的符号资源-->
            <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Size="9" Color="Red" Style="Circle" />
            <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol2" Size="9" Color="#00CC66 " Style="Circle" />
            <esri:SimpleFillSymbol x:Key="mengbanFillSymbol" Fill="#FFFFFF" BorderBrush="LightGray" BorderThickness="0" />
            <esri:SimpleFillSymbol x:Key="DefaultFillSymbolToolBar" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" />
            <esri:SimpleRenderer x:Key="StopRenderer">
                <esri:SimpleRenderer.Symbol>
                    <esri:SimpleMarkerSymbol Size="15" Style="Triangle" Color="Green" />
                </esri:SimpleRenderer.Symbol>
            </esri:SimpleRenderer>
            <esri:MarkerSymbol x:Name="SelectMarkerSymbol">
                <esri:MarkerSymbol.ControlTemplate>
                    <ControlTemplate>
                        <Canvas>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard RepeatBehavior="Forever">

                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="10" Duration="00:00:01" />

                                            <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="10" Duration="00:00:01" />

                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)" From="1" To="0" Duration="00:00:01" />
                                        </Storyboard>
                                    </VisualState>

                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" RenderTransformOrigin="0.5,0.5" x:Name="ellipse" IsHitTestVisible="False">
                                <Ellipse.RenderTransform>
                                    <ScaleTransform />
                                </Ellipse.RenderTransform>
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#00FF0000" />
                                        <GradientStop Color="#FFFF0000" Offset="0.25" />
                                        <GradientStop Color="#00FF0000" Offset="0.5" />
                                        <GradientStop Color="#FFFF0000" Offset="0.75" />
                                        <GradientStop Color="#00FF0000" Offset="1" />
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" Fill="#FFFF0000" x:Name="ellipse1" />
                        </Canvas>
                    </ControlTemplate>
                </esri:MarkerSymbol.ControlTemplate>
            </esri:MarkerSymbol>
            <!--选中或定位后闪烁点的符号资源-->
            <esri:Envelope x:Key="StartExtent" XMin="109." YMin="30.47" XMax="118.5" YMax="37.38" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <esri:Map Grid.Row="1" x:Name="myMap">
            <esri:ArcGISTiledMapServiceLayer ID="BaseMapLayer" Url="http://218.28.143.250:59993/ArcGIS/rest/services/map8/MapServer" />
            <esri:GraphicsLayer ID="MyGraphicsLayer"/>
            <esri:GraphicsLayer ID="MyGraphicsLayerflare"/>
        </esri:Map>

        <ComboBox x:Name="SelectedCity"  Width="150" Height="30" Foreground="Red" FontSize="14" 
                     HorizontalAlignment="Left" VerticalAlignment="Top"
                      Background="#FF2088C1" SelectionChanged="SelectedCity_SelectionChanged">
            <!--<ComboBoxItem Content="请选择" FontWeight="Bold" FontSize="14" IsSelected="True" />-->
        </ComboBox>
        <esri:MapProgressBar x:Name="MyProgressBar" 
			Map="{Binding ElementName=myMap}"
			HorizontalAlignment="Center" VerticalAlignment="Center"
			Width="200" Height="36"
			Margin="25"  />
        <!--maptip提示-->
        <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
            <esri:MapTip x:Name="MyMapTip"  BorderBrush="#99000000" 
                BorderThickness="1" Title="{Binding [NAME]}"  VerticalOffset="10" 
                HorizontalOffset="10" Background="#DDFFFFFF" IsEnabled="False" />
        </Canvas>
        <!--定位到村模块-->
        <Canvas x:Name="ResultsDisplayCanvas" HorizontalAlignment="Right" VerticalAlignment="Top"
                                 Width="320" Height="50" Visibility="Collapsed" >
            <Rectangle Stroke="Blue"  RadiusX="10" RadiusY="10" Fill="#FB4694C9"
                                Canvas.Left="0"  Width="320" Height="50" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <StackPanel Orientation="Horizontal" AllowDrop="True"
                                 Height="50" Width="320">
                <TextBlock Text=" 请选择名称: " FontSize="14" Canvas.Left="5"
                                VerticalAlignment="Stretch" Width="90" Height="30" />
                <TextBox  x:Name="CountyName"  Width="100" Height="30" Foreground="Red" FontSize="14"/>
                <Button Content="定  位" Width="100" VerticalAlignment="Center" Height="30" Name="QueryButton"
                                HorizontalAlignment="Right" Margin="0,0,10,0" Cursor="Hand"  OpacityMask="#FF250000" Click="QueryButton_Click">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                            <GradientStop Color="#FF00282B" Offset="0.145" />
                            <GradientStop Color="White" Offset="1" />
                        </LinearGradientBrush>
                    </Button.Background>
                </Button>
            </StackPanel>
        </Canvas>

        <Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="280" Width="516">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height ="110"/>
                    <RowDefinition Height ="110 "/>
                    <RowDefinition Height ="60"/>
                </Grid.RowDefinitions>
                <!--主工具条-->

                <Image Grid.Row ="2" VerticalAlignment="Bottom"  HorizontalAlignment="Center" Height="41" Width="514" Stretch="Uniform" Source="images/table.png" />
                <StackPanel Orientation="Vertical" Grid.Row="1" Grid.RowSpan="2">
                    <esri:Toolbar x:Name="barWidgets" MaxItemHeight="90" MaxItemWidth="90"  ToolbarItemClicked="Toolbar_ToolbarItemClicked"
                           VerticalAlignment="Bottom" HorizontalAlignment="Center" Width="Auto" Height="Auto" Margin="0,0,0,-140" >
                        <esri:Toolbar.Items>
                            <esri:ToolbarItemCollection>
                                <esri:ToolbarItem Text="选择区域-红色：离线；绿色：在线">
                                    <esri:ToolbarItem.Content>
                                        <Image Source="images/button_tools.png" Margin="0,0,20,0" Height="74" Width="64" Stretch="UniformToFill">
                                            <ToolTipService.ToolTip>
                                                <StackPanel>
                                                    <TextBlock Text="选择区域-红色：离线；绿色：在线" FontFamily="Arial" FontSize="14" Foreground="CornflowerBlue"/>
                                                </StackPanel>
                                            </ToolTipService.ToolTip>
                                        </Image>

                                    </esri:ToolbarItem.Content>
                                </esri:ToolbarItem>
                                <esri:ToolbarItem Text="村庄定位">
                                    <esri:ToolbarItem.Content>
                                        <Image Source="images/button_course.png" Margin="0,0,20,0" Height="74" Width="64" Stretch="UniformToFill" >
                                            <ToolTipService.ToolTip>
                                                <StackPanel>
                                                    <TextBlock Text="村庄定位" FontFamily="Arial" FontSize="14" Foreground="CornflowerBlue" />
                                                </StackPanel>
                                            </ToolTipService.ToolTip>
                                        </Image>
                                    </esri:ToolbarItem.Content>
                                </esri:ToolbarItem>
                                <esri:ToolbarItem Text="">
                                    <esri:ToolbarItem.Content>
                                        <Image Source="images/button_HotPoint.png" Margin="0,0,20,0" Height="74" Width="64" Stretch="UniformToFill">
                                            <ToolTipService.ToolTip>
                                                <StackPanel>
                                                    <TextBlock Text="后续。。。" FontFamily="Arial" FontSize="14" Foreground="CornflowerBlue"/>
                                                </StackPanel>
                                            </ToolTipService.ToolTip>
                                        </Image>
                                    </esri:ToolbarItem.Content>
                                </esri:ToolbarItem>
                                <esri:ToolbarItem Text="后续。。。">
                                    <esri:ToolbarItem.Content>
                                        <Image Source="images/button_Details.png" Margin="0,0,20,0" Height="74" Width="64" Stretch="UniformToFill">
                                            <ToolTipService.ToolTip>
                                                <StackPanel>
                                                    <TextBlock Text="后续。。。" FontFamily="Arial" FontSize="14" Foreground="CornflowerBlue"/>
                                                </StackPanel>
                                            </ToolTipService.ToolTip>
                                        </Image>
                                    </esri:ToolbarItem.Content>
                                </esri:ToolbarItem>
                                <esri:ToolbarItem Text="全屏切换">
                                    <esri:ToolbarItem.Content>
                                        <Image Source="images/button_FullScreen.png" Margin="0,0,0,0" Height="74" Width="64" Stretch="UniformToFill">
                                            <ToolTipService.ToolTip>
                                                <StackPanel>
                                                    <TextBlock Text="全屏切换" FontFamily="Arial" FontSize="14" Foreground="CornflowerBlue"/>
                                                </StackPanel>
                                            </ToolTipService.ToolTip>
                                        </Image>
                                    </esri:ToolbarItem.Content>
                                </esri:ToolbarItem>
                            </esri:ToolbarItemCollection>
                        </esri:Toolbar.Items>
                    </esri:Toolbar>
                </StackPanel>
            </Grid>
        </Grid>

    </Grid>
</UserControl>
